<!--发布月刊-->
<div class="container-fluid">
  <div class="page-header">
    <div class="pull-left">
      <h4>发布月刊</h4>
    </div>
  </div>
  <h4 class="text-center">
    学生实训期间需按规定交由学生组长发布月刊，展示学生实训动态
  </h4>
  <hr/>
  <div id="dailyRecordForm">
    <!--title-->
    <div class="form-group">
      <input id="monthlyTitle" type="text" class="form-control" placeholder="标题">
    </div>
    <div class="editor">
      <script id="monthlyEditor" type="text/plain" style="width:100%;height:500px;opacity: 0.8;"></script>
    </div>
    <div class="text-center" style="margin-top: 25px">
      <span type="button" class="btn btn-lg btn-primary" onclick="postDailyRecord()">发布</span>
    </div>
  </div>
</div>
<!--script type="text/javascript">
  var ue;
  //初始化编辑器
  UE.delEditor('monthlyEditor');
  var ue = UE.getEditor('monthlyEditor');


  /**
   * 发布日志
   */
  function postDailyRecord() {
    //获取用户输入数据
    var title = $('#monthlyTitle').val();
    var content = ue.getContent();
    console.log(title);
    console.log(content);
    //判断用户行为是否合法
    if (strIsEmpty(title) || strIsEmpty(content)) {
      $.notify("标题或内容不得为空!", {
        position: 'top center',
        className: 'error'
      });
      return;
    }

    $.ajax({
      url: 'resource/tmp/success',
      data: {
        title: title,
        content: content,
      },
      success: function (data) {
        if (data == 'success') {
          //选择成功
          $.notify("发布月刊成功!", {
            position: 'top center',
            className: 'success'
          });
        } else {
          //选择失败
          $.notify("发布月刊失败!", {
            position: 'top center',
            className: 'error'
          });
        }
      },
      error: function (data) {
        //选择失败
        $.notify("发布月刊失败!", {
          position: 'top',
          className: 'error'
        });
      }
    })
  }

</script-->